Carlos Garnacho [Mon, 5 May 2014 12:21:36 +0000 (14:21 +0200)]
gesture: Handle GDK_TOUCH_CANCEL events
The wayland windowing backend emits such events for instance, so
have gestures cancel the sequence as those events get through.
Carlos Garnacho [Mon, 28 Apr 2014 10:53:36 +0000 (12:53 +0200)]
gesture: Protect against odd window hierarchies
If no match is found with the gesture widget when poking the event
window parents, bail out safely instead of falling in an infinite
loop. This was seen on Mutter.
Carlos Garnacho [Thu, 17 Apr 2014 11:05:11 +0000 (13:05 +0200)]
swipe: Don't emit ::swipe if there are still active touches
Avoids sending spurious signals when an extra touch happens.
Matthias Clasen [Tue, 6 May 2014 02:40:18 +0000 (22:40 -0400)]
Prevent subclassing of gestures
For now, at least. We do this by hiding the instance and
class structures in private headers.
Matthias Clasen [Fri, 2 May 2014 02:05:42 +0000 (22:05 -0400)]
GtkSpinButton: Don't leak the gestures
Matthias Clasen [Fri, 2 May 2014 02:00:01 +0000 (22:00 -0400)]
GtkWindow: Don't leak the gesture
Matthias Clasen [Fri, 2 May 2014 01:53:35 +0000 (21:53 -0400)]
GtkTreeView: Remove unused field
Matthias Clasen [Fri, 2 May 2014 01:01:33 +0000 (21:01 -0400)]
gtk3-demo: Don't leak the color chooser
Matthias Clasen [Fri, 2 May 2014 01:00:28 +0000 (21:00 -0400)]
GtkColorPlane: Actually add the long press gesture
This was missed because gtk_widget_remove_controller silently
does nothing on unowned controllers.
Matthias Clasen [Fri, 2 May 2014 00:58:13 +0000 (20:58 -0400)]
GtkButton: Don't leak the gesture
Matthias Clasen [Fri, 2 May 2014 00:26:40 +0000 (20:26 -0400)]
Forgotten file
Matthias Clasen [Fri, 2 May 2014 00:15:40 +0000 (20:15 -0400)]
GtkButton: Port to GtkGesture
Quick-and-dirty patch to use a GtkGestureSingle for both
button press/release and touch event handling.
Carlos Garnacho [Thu, 10 Apr 2014 11:56:55 +0000 (13:56 +0200)]
widget: remove GtkGesture-related signals
The utility of those signals is somewhat dubious now that there is
gtk_gesture_group(), so make that the only way to coordinate gestures.
The cooperation model offered by gtk_gesture_group() is flexible
enough,
Carlos Garnacho [Thu, 10 Apr 2014 11:46:03 +0000 (13:46 +0200)]
docs: Add missing GtkEventController functions
Carlos Garnacho [Thu, 10 Apr 2014 11:45:38 +0000 (13:45 +0200)]
widget: Add docs for GtkGesture-related API
Carlos Garnacho [Thu, 10 Apr 2014 11:45:19 +0000 (13:45 +0200)]
gesturesingle: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:45:06 +0000 (13:45 +0200)]
zoom: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:45:00 +0000 (13:45 +0200)]
swipe: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:44:49 +0000 (13:44 +0200)]
rotate: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:44:06 +0000 (13:44 +0200)]
pan: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:43:53 +0000 (13:43 +0200)]
multipress: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:43:41 +0000 (13:43 +0200)]
longpress: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:43:27 +0000 (13:43 +0200)]
drag: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:43:15 +0000 (13:43 +0200)]
gesture: doc fixes
Carlos Garnacho [Thu, 10 Apr 2014 11:43:01 +0000 (13:43 +0200)]
eventcontroller: doc fixes
Carlos Garnacho [Wed, 9 Apr 2014 16:29:48 +0000 (18:29 +0200)]
docs: Add missing controller/gesture docs
Carlos Garnacho [Wed, 9 Apr 2014 16:29:02 +0000 (18:29 +0200)]
pan: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:28:49 +0000 (18:28 +0200)]
zoom: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:28:43 +0000 (18:28 +0200)]
rotate: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:28:27 +0000 (18:28 +0200)]
swipe: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:28:20 +0000 (18:28 +0200)]
drag: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:28:12 +0000 (18:28 +0200)]
longpress: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:28:03 +0000 (18:28 +0200)]
multipress: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:27:50 +0000 (18:27 +0200)]
gesturesingle: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:27:42 +0000 (18:27 +0200)]
gesture: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:27:31 +0000 (18:27 +0200)]
eventcontroller: Add missing documentation
Carlos Garnacho [Wed, 9 Apr 2014 16:27:11 +0000 (18:27 +0200)]
enums: Add missing docs to controller/gesture enums
Carlos Garnacho [Tue, 8 Apr 2014 19:27:49 +0000 (21:27 +0200)]
Remove GtkPressAndHold
This is replaced by GtkGestureLongPress, and all its callers have
been updated to use the replacement.
Carlos Garnacho [Tue, 8 Apr 2014 19:27:08 +0000 (21:27 +0200)]
enums: Document GtkPropagationPhase
Carlos Garnacho [Tue, 8 Apr 2014 19:24:54 +0000 (21:24 +0200)]
spinbutton: increase/decrease value on upwards/downwards touch swipes
This is somewhat analogous to scroll events on pointer devices, the
greater the velocity, the faster the spinbutton spins.
Carlos Garnacho [Tue, 8 Apr 2014 19:21:56 +0000 (21:21 +0200)]
Add GtkGesturePan
This gesture reports events on horizontal/vertical panning gestures.
Carlos Garnacho [Tue, 8 Apr 2014 19:21:14 +0000 (21:21 +0200)]
range: Replace GtkPressAndHold with GtkGestureLongPress
Carlos Garnacho [Tue, 8 Apr 2014 19:19:46 +0000 (21:19 +0200)]
swipe: Add function to retrieve the current velocity
This can be used to fetch the current velocity on update(), as opposed
to swipe() which happens after the sequence is finished.
Carlos Garnacho [Tue, 8 Apr 2014 19:18:38 +0000 (21:18 +0200)]
colorswatch: Replace GtkPressAndHold
GtkGestureLongPress and GtkGestureMultiPress are both used
to replace it.
Carlos Garnacho [Tue, 8 Apr 2014 19:17:54 +0000 (21:17 +0200)]
colorscale: Replace GtkPressAndHold with GtkLongPressGesture
Carlos Garnacho [Tue, 8 Apr 2014 19:17:00 +0000 (21:17 +0200)]
colorplane: Replace GtkPressAndHold with GtkLongPressGesture
Carlos Garnacho [Tue, 8 Apr 2014 19:15:06 +0000 (21:15 +0200)]
entry: Don't show text handles too eagerly on button press
Instead do so on button release, or after text selection dragging
starts.
Carlos Garnacho [Tue, 8 Apr 2014 19:11:27 +0000 (21:11 +0200)]
longpress: Ensure check() happens after cancel()
And delegate on GtkGesture::check(), it does deal better with
extra fleeting touches.
Carlos Garnacho [Tue, 8 Apr 2014 19:10:43 +0000 (21:10 +0200)]
longpress: fix reentrancy on ::reset()
Carlos Garnacho [Tue, 8 Apr 2014 19:09:44 +0000 (21:09 +0200)]
gesturemultipress: fix reentrancy on ::reset()
Carlos Garnacho [Tue, 8 Apr 2014 19:06:39 +0000 (21:06 +0200)]
gesturesingle: check the current sequence before resetting the pressed button
Carlos Garnacho [Tue, 8 Apr 2014 19:05:00 +0000 (21:05 +0200)]
scrolledwindow: update to gesture widget-level API changes
Carlos Garnacho [Tue, 8 Apr 2014 19:03:07 +0000 (21:03 +0200)]
window: update to gesture widget-level API changes
Carlos Garnacho [Tue, 8 Apr 2014 19:02:44 +0000 (21:02 +0200)]
treeview: update to gesture widget-level API changes
Carlos Garnacho [Tue, 8 Apr 2014 19:01:47 +0000 (21:01 +0200)]
drag: remove unused #define
Carlos Garnacho [Tue, 8 Apr 2014 19:01:13 +0000 (21:01 +0200)]
eventcontroller: Add documentation blurb
Carlos Garnacho [Tue, 8 Apr 2014 19:00:26 +0000 (21:00 +0200)]
dnd: Update to gesture widget-level API changes
Carlos Garnacho [Tue, 8 Apr 2014 18:59:16 +0000 (20:59 +0200)]
demo: Update to gesture widget-level API changes
Carlos Garnacho [Tue, 8 Apr 2014 18:55:30 +0000 (20:55 +0200)]
widget: refactor gesture integration
Listen for notify::sequence-state-changed on the controller, so the
only way to manipulate a sequence state are gtk_gesture_set_sequence_state()
and gtk_gesture_set_state().
Also, make use of gesture groups, so the sequence state is set at once
on all gestures pertaining to a single group. Within a widget, if a sequence
is claimed on one group, it is made to be denied on every other group.
Carlos Garnacho [Tue, 8 Apr 2014 18:47:38 +0000 (20:47 +0200)]
gesture: Add grouping API
This API eliminates the need for overriding
GtkWidget::sequence-state-changed virtually everywhere. Grouped
gestures share common states for a same GdkEventSequence, so the
state of sequences stay in sync across those.
Carlos Garnacho [Tue, 8 Apr 2014 18:46:26 +0000 (20:46 +0200)]
gesture: Add gtk_gesture_set_state() helper.
This function sets the state on all sequences where it actually
can, just a helper function to avoid iterating over sequences
yourself.
Carlos Garnacho [Tue, 8 Apr 2014 18:45:18 +0000 (20:45 +0200)]
gesture: emit the current state on ::sequence-state-changed
Carlos Garnacho [Tue, 8 Apr 2014 18:44:38 +0000 (20:44 +0200)]
gesture: group continue conditions together
Carlos Garnacho [Tue, 8 Apr 2014 18:43:52 +0000 (20:43 +0200)]
gesture: return TRUE if the sequence state was already set
Carlos Garnacho [Tue, 8 Apr 2014 18:41:09 +0000 (20:41 +0200)]
gesture: fix compiler warning
Carlos Garnacho [Tue, 8 Apr 2014 18:39:44 +0000 (20:39 +0200)]
gesture: ignore events if now widget window was found
Carlos Garnacho [Tue, 8 Apr 2014 18:25:53 +0000 (20:25 +0200)]
eventcontroller: Add propagation-phase property
This is so we don't have to specify the capture phase for
every controller. The default "bubble" value will be sane
on most situations.
Carlos Garnacho [Tue, 8 Apr 2014 18:24:30 +0000 (20:24 +0200)]
treeview: remove superfluous GTK+ grabs
Carlos Garnacho [Tue, 8 Apr 2014 18:23:43 +0000 (20:23 +0200)]
textview: remove superfluous GTK+ grabs
Carlos Garnacho [Tue, 8 Apr 2014 18:23:00 +0000 (20:23 +0200)]
iconview: remove superfluous GTK+ grabs
Carlos Garnacho [Tue, 8 Apr 2014 18:21:50 +0000 (20:21 +0200)]
combobox: remove superfluous GTK+ grabs
Carlos Garnacho [Tue, 8 Apr 2014 18:21:17 +0000 (20:21 +0200)]
cellrendereraccel: remove superfluous GTK+ grabs
Carlos Garnacho [Thu, 3 Apr 2014 12:44:58 +0000 (14:44 +0200)]
Revert "gtk: Remove propagation limit of captured events on the grab widget"
This reverts commit
6511f411955adba4f960b8b07d39b93785afe33e.
Carlos Garnacho [Mon, 31 Mar 2014 10:27:43 +0000 (12:27 +0200)]
longpress: Use xsettings to determine long press duration
GtkSettings::gtk-long-press-time is used to this effect.
Carlos Garnacho [Mon, 31 Mar 2014 10:22:11 +0000 (12:22 +0200)]
settings: Add gtk-long-press-time setting
This setting determines the duration of a button/touch press to
be considered a long press.
Carlos Garnacho [Fri, 28 Mar 2014 14:44:11 +0000 (15:44 +0100)]
window: Use gestures for window moving/resizing
A multipress gesture is used to control all this, replacing
single/double click custom code, and triggering window dragging
when the multipress is stopped, yet active (ie. the sequence remains
pressed).
Carlos Garnacho [Thu, 27 Mar 2014 11:31:28 +0000 (12:31 +0100)]
treeview: Use multipress gesture for row activation
Replace custom double click detection with multipress gesture
Carlos Garnacho [Fri, 28 Mar 2014 22:23:38 +0000 (23:23 +0100)]
dnd: Use GtkGestureDrag to initiate DnD
This gesture is used by gtk_drag_source_set() to determine
whether dragging moved past the threshold. The gesture events
are handled via the usual ::event callbacks, so we don't mess
up with callers expecting that to happen in a signal handler.
If the sequence gets claimed somewhere else in the event widget
stack, the DnD gesture will be cancelled.
Carlos Garnacho [Wed, 26 Mar 2014 13:06:09 +0000 (14:06 +0100)]
scrolledwindow: Ensure the dragging sequence gets denied if more touches come in
This allows children to receive an emulated press, and handle it together with
the new touch that made the scrolledwindow sequence denied.
Carlos Garnacho [Wed, 26 Mar 2014 09:53:42 +0000 (10:53 +0100)]
scrolledwindow: Fix overshoot coordinates
With gtk_gesture_get_point() returning events in
gtk_event_controller_get_widget() coordinates, we no longer need
to compensate for the overshoot here.
Carlos Garnacho [Wed, 26 Mar 2014 09:49:21 +0000 (10:49 +0100)]
widget: Add gtk_widget_set_gesture_state()
This helper function ensures the state is propagated for
all the active sequences in the given gesture.
Carlos Garnacho [Wed, 26 Mar 2014 09:25:09 +0000 (10:25 +0100)]
widget: Improve button press emulation on sequence denied
Ensure that state being set on pointer emulating touches actually
gets propagated properly on widgets with gestures that only handle
pointer events.
Carlos Garnacho [Tue, 25 Mar 2014 12:45:17 +0000 (13:45 +0100)]
swipe: Dont emit swipe() if the gesture was denied rather than finished
Carlos Garnacho [Tue, 25 Mar 2014 12:22:51 +0000 (13:22 +0100)]
drag: Make API offsets based
It is generally more useful to get offsets right away,
than having to calculate those from the start point.
Carlos Garnacho [Fri, 21 Mar 2014 18:23:37 +0000 (19:23 +0100)]
scrolledwindow: Use GtkGestureSingle API
Carlos Garnacho [Mon, 24 Mar 2014 13:45:55 +0000 (14:45 +0100)]
scrolledwindow: Update gesture API change.
Carlos Garnacho [Mon, 24 Mar 2014 13:44:27 +0000 (14:44 +0100)]
demo: Update to gesture API change
Carlos Garnacho [Mon, 24 Mar 2014 13:42:13 +0000 (14:42 +0100)]
widget: Reset gestures on grab-notify
If it is determined that the gesture will stop receiving
events, reset the gesture altogether.
Carlos Garnacho [Mon, 24 Mar 2014 13:35:17 +0000 (14:35 +0100)]
widget: Make helper gesture API take GtkGestures
GtkEventController may be certainly useful to keep event
handling self-contained in other places than gestures, but
the current widget API is highly related to gestures, so
just using GtkGesture as the argument there will be quite
more convenient. The other places where GtkEventController
make sense as a base object will better provide their own
hooks.
Carlos Garnacho [Mon, 24 Mar 2014 12:19:53 +0000 (13:19 +0100)]
Add: GTK_PHASE_NONE value to GtkCapturePhase.
Gestures attached with this phase will expect callers to have it
receive events through gtk_event_controller_handle_event(), but
the gesture will still be notified of sequence state changes,
grabs, etc...
Carlos Garnacho [Mon, 24 Mar 2014 12:11:47 +0000 (13:11 +0100)]
gesture: check the gesture after denying a sequence.
So the gesture emits end() timely.
Carlos Garnacho [Mon, 24 Mar 2014 12:04:51 +0000 (13:04 +0100)]
gesture: Offer always coordinates in the gesture widget coordinate space
Translate events meant for other widgets/windows, so gtk_gesture_get_point()
always returns coordinates based on the gtk_event_controller_get_widget()
allocation.
Carlos Garnacho [Mon, 24 Mar 2014 11:21:38 +0000 (12:21 +0100)]
multipress: Remove unused signal argument
Carlos Garnacho [Fri, 21 Mar 2014 18:45:27 +0000 (19:45 +0100)]
swipe: Make a subclass of GtkGestureSingle
Carlos Garnacho [Fri, 21 Mar 2014 18:39:21 +0000 (19:39 +0100)]
drag: Make a subclass of GtkGestureSingle
Carlos Garnacho [Fri, 21 Mar 2014 18:21:56 +0000 (19:21 +0100)]
multipress: Make a subclass of GtkGestureSingle
The redundant API has been removed here.
Carlos Garnacho [Fri, 21 Mar 2014 17:57:32 +0000 (18:57 +0100)]
longpress: Make a subclass of GtkGestureSingle
the redundant API here has been removed.
Carlos Garnacho [Fri, 21 Mar 2014 17:13:41 +0000 (18:13 +0100)]
gesture: Only recognize gestures with as many interacting touches as those handled
If a gesture has denied sequences (so those are presumably handled above/below
the widget), it shouldn't attempt to handle extra touches, even if those end
up matching the expected number of touches.
Carlos Garnacho [Fri, 21 Mar 2014 17:09:38 +0000 (18:09 +0100)]
gesture: Limit API calls to non-denied sequences
Gestures do track those internally, but information about those
shouldn't be leaked on calls.
Carlos Garnacho [Fri, 21 Mar 2014 16:47:06 +0000 (17:47 +0100)]
gesture: Require BUTTON_PRESS/TOUCH_BEGIN for sequences to be initiated.
Gestures should always receive one of such events in order to be activated,
and the propagation mechanism will ensure they do so if the original event
was caught up the widget hierarchy by another gesture that is now declining
the sequence.